<?php
class SolicitudEspera extends AppModel {
	var $name = 'SolicitudEspera';
	var $useTable = 'solicitudes_espera';
	var $validate = array(
		'id' => array(
			'blank' => array(
				'rule' => array('blank'),
				'on' => 'create' 
			)
		),
		'persona_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'curso_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'created' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'usuario_id' => array(
			'notEmpty' => array(
				'rule' => array('notEmpty')
			),
			'numeric' => array(
				'rule' => array('numeric')
			)
		),
		'activo' => array(
			'boolean' => array(
				'rule' => array('boolean')
			),
			'notEmpty' => array(
				'rule' => array('notEmpty')
			)
		),
		'grupo_id' => array(
			'numeric' => array(
				'rule' => array('numeric')
			)
		)
	);

	var $belongsTo = array(
		'Persona' => array(
			'className' => 'Persona',
			'foreignKey' => 'persona_id'
		),
		'Curso' => array(
			'className' => 'Curso',
			'foreignKey' => 'curso_id'
		),
		'Usuario' => array(
			'className' => 'Persona',
			'foreignKey' => 'usuario_id'
		),
		'Grupo' => array(
			'className' => 'Grupo',
			'foreignKey' => 'grupo_id'
		)
	);
	
	var $hasMany = array(
		'SolicitudEvento' => array(
			'className' => 'SolicitudEvento',
			'foreignKey' => 'solicitud_espera_id'
		)
	);
}
?>